import request from "@/request";
import type {ISysMenuResponseData, TMenuParams} from "@/api/menu/type.ts";
import type {IBaseResponseData} from "@/api/type.ts";

enum API {
    // 获取全部菜单与按钮的标识数据--地址
    SYS_ALL_MENU = "/sys/allMenu"
}

// 提交菜单 /sys/menu
export const postSysMenu = (body: TMenuParams) => request.post<any, IBaseResponseData>("/sys/menu", body);
// 获取全部菜单与按钮的标识数据
export const getSysAllMenu = () => request.get<any, ISysMenuResponseData>(API.SYS_ALL_MENU);
// 更改菜单状态:/sys/menu/:id/:status
export const putSysMenuStatusById = (id: string, status: number) => request.put<any, IBaseResponseData>(`/sys/menu/${id}/${status}`)
// 修改菜单 http://zhangpeiyue.com:8888/sys/menu
export const putSysMenu = (body:TMenuParams) => request.put<any,IBaseResponseData>("/sys/menu",body);
// 删除菜单 /sys/menu/:id
export const deleteSysMenuById = (id:string) =>request.delete<any,IBaseResponseData>("/sys/menu/"+id);

